perm filename JOURNA[NEW,AIL] blob sn#408200 filedate 1979-01-08 generic text, type T, neo UTF8
.if xcribl then start "XGP"
.  TTY←" XGP version, 2 columns per page, both sides ";
.  sides←2;
.  page frame 62 high 82 wide;
.  title area footing line 62;
.  text area text lines 4 to 60 in 2 columns 4 apart;
.  cols←2; ssname←NULL; place text; next page;
.
.  font 1 "NGR25"	<< main text >>
.  font 2 "NGB25"	<< subsubsection titles >>
.  font 3 "NGR30"	<< section and subsection titles >>
.  font 4 "FIX20"	<< examples >>
.  font 5 "FIX20"	<< type conversion table >>
.  font 6 "GRFX25"	<< for horizontal lines in runtime titles >>
.  font 7 "NGB25"	<< for underlines >>
.  font F "00[DOC,JFR]"	<< for sneaking in revision flags >>
.  turn on "≡" for "%";
.  macro exafont⊂select 4;⊃;
.  macro lptfont⊂select 5;⊃;
.  macro gfxfont⊂select 6;⊃;
.  
.  if sides=1 then start
.	ODDLEFTBORDER←EVENLEFTBORDER←1030;
.	every heading (π2{DOCNAME⎇π*,,π2{PAGETOP⎇π*);
.	every footing (,π2{PAGE!⎇π*,);
.    end
.    else start
.	ODDLEFTBORDER←1030;  EVENLEFTBORDER←930;
.	even heading (π2{PAGETOP⎇π*,,π2{DOCNAME⎇π*);
.	odd heading (π2{DOCNAME⎇π*,,π2{PAGETOP⎇π*);
.	even footing (π2{PAGE!⎇π*,,);
.	odd footing (,,π2{PAGE!⎇π*);
.    end;
.  end "XGP"
.turn on "α"
.turn on "π" for "%"
.count page from 1 to 300;
.<< NEXT COLUMN, UPITY, UP, UP0, EXA, ENDEXA, YON >>
.
.MACRO NEXT COLUMN ⊂ SKIP TO line 1 ⊃;
.
.MACRO UPITY ⊂	<< defines UP, UP0, EXA, ENDEXA depending on XGP or TTY >>
.if xcribl then start "XGP"
.  MACRO UP0(TIT) ⊂
π3TITπ*
.⊃;
.
.  MACRO UP (TIT) ⊂
.    break; if lines<5 then next column;
π2TITπ*
.  CONTINUE
.⊃;
.  VARIABLE EXALINES; << An example which occurs in column 1 can screw the
.			line counting because the font is a different height.
.			We will try to fudge it.  21=height of font for examples,
.			26=height of main font.  24=21+3, 3=interline spacing.>>
.		      << If an example must be moved to the top of a new
.			page then this counter must be fiddled. >>
.  MACRO EXA ⊂BREAK;NOFILL;SELECT 4;GROUP;EXALINES←LINE⊃;
.  MACRO ENDEXA ⊂IF EXALINES>LINE THEN EXALINES←4; <<fiddle for crossing page>>
.	EXALINES←LINE-EXALINES; IF COLUMN<2 THEN
.	XGENLINES←XGENLINES - (EXALINES - (EXALINES*24+15)DIV 29);
.	FILL;SELECT 1;APART;⊃;
.END "XGP"
.ELSE START "TTY"
.  MACRO UP0(TIT) ⊂
↓_TIT_↓
.⊃;
.
.  MACRO UP (TIT) ⊂
.    IF LINES<4 THEN NEXT COLUMN;
↓_TIT_↓
.    CONTINUE
.⊃;
.  MACRO EXA ⊂NOFILL;GROUP;⊃;
.  MACRO ENDEXA ⊂FILL;APART;⊃;
.END "TTY";
.⊃;
.
.MACRO YON (LABEL) ⊂"page ";PAGE! LABEL⊃
.<< CONTENTSING >>
.MACRO CONTENTSING ⊂
.CONTS←"TRUE";
.
.MACRO BACKCONTENTS ⊂
.INSERT CONTENTS
.	PORTION CONTENTS
.	PAGETOP ← "TABLE OF CONTENTS"
.	TURN ON "{∂∞\→←#↓_"
.	NEXT PAGE
##
.	COUNT PAGE FROM 1 TO 10 PRINTING ⊂ ⊃;
.	NEXT PAGE;
.	CENTER
.	TABS 21,24,27,30,33,36,39,42,45,48,51,54,57,60,63
{UP0(T A B L E   O F   C O N T E N T S)⎇
.	FILL  INDENT 0,16 PREFACE 0; NOJUST; CRBREAK; 	SKIP 2
SECTION→PAGE
.	SKIP 1
.	RECEIVE
.	⊃
.⊃;
.<< FRONT, SEC, SS >>
.
.MACRO FRONT⊂
.COUNT SECTION PRINTING 1
.
.MACRO SEC(NAME,label) ⊂ 
.	BEGIN "SECTION MACRO"
.	NEXT PAGE
.	TURN ON "#"
.	PAGETOP← SCNAME ← "NAME";
.	SSNAME ← NULL ;
.	label NEXT SECTION!;
.	TURN ON "↓_{⎇←→∂" CENTER
.UP0(SECTION  {!⎇)
.	SKIP
{UP0(NAME)⎇
.	SKIP 2
.	IF CONTS="TRUE" THEN SEND CONTENTS ⊂ 
.		APART;
.		SKIP 2;
.		GROUP;
{SECTION!⎇∂4NAME→{page!⎇{BREAK 
.		SKIP 1;
.		⊃;
.	END "SECTION MACRO"
.⊃;
.COUNT SUBSECTION IN SECTION PRINTING "!.1"
.
.MACRO SS(NAME,label) ⊂ 
.	BEGIN "SUBSECTION MACRO"
.	SSNAME←"NAME";
.	IF LINES<12 THEN NEXT COLUMN; label NEXT SUBSECTION!;
.	FILL; IF SUBSECTION>1 AND LINE>1 THEN SKIP 2 ELSE SKIP 0;
.	TURN ON "{∂∞→#↓_"
.	IF CONTS="TRUE" THEN SEND CONTENTS ⊂
∂(4){SUBSECTION⎇∂(7)NAME→{PAGE!⎇
. 		⊃;
{subSECTION!⎇##{UP0(NAME)⎇
.	IF PAGE=SSPAGE THEN BEGIN "SSPP"
.	  COMMENT 3 SS ON A PAGE CAUSE LINE COUNT FUCKUP;
.	  SSPERPAGE←SSPERPAGE+1;  IF SSPERPAGE≥3 THEN BEGIN
.	    SSPERPAGE←0; XGENLINES←XGENLINES-1 END;
.	END "SSPP" ELSE SSPERPAGE←1;
.	SSPAGE←PAGE;
.	END "SUBSECTION MACRO"
.⊃;
.COUNT ssscnt IN subSECTION PRINTING "!.1"
.
.MACRO sSS(NAME,label) ⊂ 
.	BEGIN "Sss MACRO"
.	IF LINES<12 THEN NEXT COLUMN; label NEXT ssscnt!;
.	FILL; IF ssscnt>1 AND LINE>1 THEN SKIP 2 ELSE SKIP 0;
.	TURN ON "{∂∞→#↓_"
{ssscnt!⎇##{UP0(NAME)⎇
.	IF PAGE=SSPAGE THEN BEGIN "SSPP"
.	  COMMENT 3 SS ON A PAGE CAUSE LINE COUNT FUCKUP;
.	  SSPERPAGE←SSPERPAGE+1;  IF SSPERPAGE≥3 THEN BEGIN
.	    SSPERPAGE←0; XGENLINES←XGENLINES-1 END;
.	END "SSPP" ELSE SSPERPAGE←1;
.	SSPAGE←PAGE;
.	END "Sss MACRO"
.⊃;
.COUNT sssscnt IN ssscnt PRINTING "!.1"
.
.MACRO ssSS(NAME,label) ⊂ 
.	BEGIN "ssss MACRO"
.	IF LINES<12 THEN NEXT COLUMN; label NEXT sssscnt!;
.	FILL; IF sssscnt>1 AND LINE>1 THEN SKIP 2 ELSE SKIP 0;
.	TURN ON "{∂∞→#↓_"
{sssscnt!⎇##{UP0(NAME)⎇
.	IF PAGE=SSPAGE THEN BEGIN "SSPP"
.	  COMMENT 3 SS ON A PAGE CAUSE LINE COUNT FUCKUP;
.	  SSPERPAGE←SSPERPAGE+1;  IF SSPERPAGE≥3 THEN BEGIN
.	    SSPERPAGE←0; XGENLINES←XGENLINES-1 END;
.	END "SSPP" ELSE SSPERPAGE←1;
.	SSPAGE←PAGE;
.	END "ssss MACRO"
.⊃;
.
.⊃;
.<< INDEXING, BACKINDEX >>
.MACRO INDEXING ⊂
.    AT "%"  PHRASE  "%"  ⊂
.		"PHRASE" ;
.		TURN ON "{"
.		SEND INDEX ⊂⎇<<{PAGE!⎇#PHRASE#{  ⊃
.		TURN OFF	   ⊃;
.
.    AT "β" PHRASE "β" ⊂
.		TURN ON "{"
.             	SEND INDEX ⊂⎇<<{PAGE!⎇#PHRASE#{⊃
.		TURN OFF  ⊃;
.    MACRO BACKINDEX ⊂
.	SCNAME ← SSNAME ← NULL
.	PAGETOP ← "INDEX"
.	IF CONTS="TRUE" THEN SEND CONTENTS ⊂
.		SKIP 2
.		APART
∂5INDEX→{PAGE!⎇
.		⊃
.	PORTION INDEX
.
.	WASWORD ← WASLETT ← WASPG ← NULL ;
.	AT "<<" PGNO "#" PHRASE "#" ⊂
.		TURN ON "↑"; LETT ← ↑("PHRASE"[1]); TURN OFF;
.    		IF LINES<2 THEN NEXT COLUMN;
.		IF WASLETT≠LETT THEN SKIP 1;
.		IF "PHRASE" ≠ WASWORD THEN START BREAK ⎇PHRASE##PGNO{ END
.		ELSE IF "PGNO" ≠ WASPG THEN ⎇,#PGNO{ ;
.		WASPG ← "PGNO" ; WASLETT ← LETT ; WASWORD ← "PHRASE" ; ⊃
.
.	FILL  INDENT 0,3 PREFACE 0; NOJUST; CRBREAK; TURN ON "←⎇{#"
←INDEX
.	SKIP 4
.	RECEIVE "##"
.    ⊃;
.⊃;
.<< APE, APPEND >>
.COUNT AP PRINTING "A";
.
.MACRO APPENDix (NAME,label) ⊂
.BEGIN
.label NEXT AP
.pagetop←"name";
.skip to line 1;
.turn on "↓_"
.CENTER
.up0(APPENDIX {AP!⎇)
.SKIP
.up0(NAME)
.SKIP 
.SKIP
.END
.
.IF CONTS="TRUE" THEN SEND CONTENTS ⊂
.SKIP 2
∂5APPENDIX {AP!⎇:##NAME→{PAGE!⎇{BREAK 
. 		⊃;
.⊃
.MACRO APP(LBL) ⊂ "Appendix A" ;  ⊃
.<< LIST, FUNK, REFER, PREF, BNF, REV, ENDREV, GET >>
.
.MACRO FUNK(N) ⊂			COMMENT to make runtimes stand out - start descr with FILL;
.IF LINES<8 THEN 
.START  NEXT COLUMN;
.END  ELSE SKIP 3;
.BEGIN ;
.TURN ON "∞∂#←→"; TURN OFF "α"
.IF XCRIBL THEN START "FU"
π6∞α←π*#N#π6∞α→π*
.END "FU" ELSE START "NK"
∞*∂(((RMARG - 2 - LMARG - LENGTH("N"))DIV 2))##N##∞*∂((RMARG-1))
.;
.END "NK";
.SKIP
.END
.NOFILL
.⊃
.
.MACRO REFER (lab,ARGUMENT) ⊂
.begin
.lab: next refrnc 
.indent  0,4
{refrnc⎇.##ARGUMENT{break 
.end ⊃
.
.macro ref(lab) ⊂
. ; "[" ; Refrnc lab ; "]"; 
.⊃
.
.
.COUNT REVISION INLINE FROM 1 TO 999

.MACRO REV ⊂NEXT REVISION;⎇πF:{REVISION!⎇,π*{⊃;

.MACRO ENDREV ⊂⎇πF:{REVISION!⎇;π*{⊃;

.<< GOGOGO, MAN_FRONT, TST_FRONT, STAND_FRONT, MAN_BACK >>
.
.MACRO GOGOGO ⊂
.PORTION MAINPORTION
.TURN ON "{\α#↓_";
.TABS 8,16,RMARG;
.⊃;
.
.MACRO MAN_FRONT ⊂
.DOCNAME←"SAIL TUTORIAL"
.UPITY;
.CONTENTSING;
.INDEXING;
.FRONT;
.GOGOGO;
.MACRO MAN_BACK ⊂
.  BACKINDEX;
.  BACKCONTENTS;⊃;
.⊃;
.
.MACRO STAND_FRONT ⊂
.UPITY;
.CONTENTSING;
.FRONT;
.GOGOGO;
.MACRO MAN_BACK ⊂ BACKINDEX ⊃;
.⊃;
.CONTS←TRUE; SSPAGE←NULL; SSPERPAGE←0;
.MAN_FRONT;
.maxtemplate←8500;
.if xcribl then
.    start 
.	macro underlinebetween (initial, terminator) ⊂
.at "initial" phrase "terminator" ⊂ ⎇≡7phrase≡*{ ⊃
.⊃
.	at ">>" phrase ">" ⊂ ⎇≡4phrase≡*{ ⊃
.    end else
.    start
.	macro underlinebetween (initial, terminator) ⊂
.at "initial" phrase "terminator" ⊂ turn on "{" ⎇↓_phrase_↓{ ; turn off ; ⊃
.⊃
.	at ">>" phrase ">" ⊂ turn on "{" ⎇↓_phrase_↓{ ; turn off ; ⊃
.    end;
.
.!SPACES ← "#####################################################" ;
.!HYPHENS ← "--------------------------------------------------------------" ;
.MACRO SCRIPTS ⊂ TURN ON "↑↓[]&_∪" ⊃
.MACRO GREEKS ⊂ TURN ON "{∂\αβ#←→∞" ⊃
.MACRO FORMAT ⊂ SCRIPTS ; GREEKS ⊃
.macro skipc $( skip to line 1 )$
.MACRO ACKNOWLEDGE ⊂ACKNOWLEDGING ← "YES";
.	SEND ACKNOWLEDGMENTS
.⊃
.MACRO titlepage ⊂titleing ← "YES";
.	SEND titpage
.⊃
.MACRO STOPTEXT ⊂BEGIN NOFILL NOJUST INDENT 0 SPREAD←1;⊃
.MACRO STARTTEXT ⊂END
.CONTINUE⊃
.MACRO CROWN (X,Y,Z) ⊂
.begin
.if not setorigmargs then
.start
.setorigmargs←true;
.origlmarg←lmarg;
.origrmarg←rmarg;
.origind←indent1;
.end;
.IF "Z" NEQ NULL THEN NARROW 0,Z;
.IF "X" NEQ NULL THEN INDENT1←X ELSE INDENT1←0;
.IF "Y" NEQ NULL THEN INDENT2←Y ELSE INDENT2←4;
.single space
.⊃
.MACRO ENDCROWN ⊂
.END CONTINUE
.⊃
.AT 8 ⊂if filling then start break; end
.   else "        " ⊃
.AT NULL ⊂IF NOT FILLING THEN SKIP 1⊃
.crspace
.MACRO YONSEC(LBL) ⊂ "Section " ; sECTION! LBL ⊃
.MACRO YONSS(LBL) ⊂ "Section " ; SUBSECTION! LBL ⊃
.MACRO YONSSS(LBL) ⊂ "Section " ; SSSCNT! LBL ⊃
.MACRO YONSSSS(LBL) ⊂ "Section " ; SSSSCNT! LBL ⊃
.MACRO YONPAGE(LBL) ⊂ "page " ; PAGE! LBL ⊃
.MACRO YONP(LBL) ⊂ "p. "; PAGE! LBL ⊃
.setorigmargs←false;
.needresetmargs←false;
.
.COUNT REFRNC INLINE PRINTING "1"
.comment EVERY FOOTING(,{if page! = 1 then null else PAGE!⎇,);
.compact
.TURN ON "%[]↑&#{↓α_"
.turn off "%";
.ACKNOWLEDGING ← "NO";
.abstracting ← "NO";
.titleing ← "NO";
.USINGINDEX ← "NO";
.macro outline (form1,form2,form3,form4,form5) ⊂
.begin
.if not setorigmargs then
.start
.setorigmargs←true;
.origlmarg←lmarg;
.origrmarg←rmarg;
.origind←indent1;
.end;
.single space
.oindent1←indent1;
.oindent2←indent2;
.oindent3←indent3;
.lev1indent←0; lev2indent←4; lev3indent←8; lev4indent←12; lev5indent←16;
.rightmargindent←0;
.if "form1" = null then
.start
.count Lev1 from 1 to 30 printing "I."
.end
.else
.start
.count lev1 from 1 to 30 printing "form1"
.end;
.if "form2" = null then
.start
.count Lev2 from 1 to 30 in lev1 printing "A."
.end
.else
.start
.count lev2 from 1 to 30 in lev1 printing "form2"
.end;
.if "form3" = null then
.start
.count Lev3 from 1 to 30 in lev2 printing "1."
.end
.else
.start
.count lev3 from 1 to 30 in lev2 printing "form3"
.end;
.if "form4" = null then
.start
.count Lev4 from 1 to 30 in lev3 printing "a."
.end
.else
.start
.count lev4 from 1 to 30 in lev3 printing "form4"
.end;
.if "form5" = null then
.start
.count Lev5 from 1 to 30 in lev4 printing "i."
.end
.else
.start
.count lev5 from 1 to 30 in lev4 printing "form5"
.end;
.⊃
.macro endoutline ⊂
.indent1←oindent1;
.indent2←oindent2;
.indent3←oindent3;
.end continue
.⊃
.macro setoutlineindents (lev1i,lev2i,lev3i,lev4i,lev5i,rightmargi) ⊂
.if "lev1i" neq null then lev1indent←lev1i; 
.if "lev2i" neq null then lev2indent←lev2i;
.if "lev3i" neq null then lev3indent←lev3i;
.if "lev4i" neq null then lev4indent←lev4i;
.if "lev5i" neq null then lev5indent←lev5i;
.if "rightmargi" neq null then rightmargindent←rightmargi;
.⊃
.macro L1 ⊂
.indent1←lev1indent;
.indent3←rightmargindent;
.next lev1;
.indent2←(length(lev1!)+2+lev1indent);
.break
{lev1!⎇##{
.⊃
.macro L2 ⊂
.indent1←lev2indent;
.indent3←rightmargindent;
.next lev2;
.indent2←(length(lev2!)+2+lev2indent);
.break
{lev2!⎇##{
.⊃
.macro L3 ⊂
.indent1←lev3indent;
.indent3←rightmargindent;
.next lev3;
.indent2←(length(lev3!)+2+lev3indent);
.break
{lev3!⎇##{
.⊃
.macro L4 ⊂
.indent1←lev4indent;
.indent3←rightmargindent;
.next lev4;
.indent2←(length(lev4!)+2+lev4indent);
.break
{lev4!⎇##{
.⊃
.macro L5 ⊂
.indent1←lev5indent;
.indent3←rightmargindent;
.next lev5;
.indent2←(length(lev5!)+2+lev5indent);
.break
{lev5!⎇##{
.⊃
.macro list (leftmarg,rightmarg,inden,printform) ⊂
.begin
.if not setorigmargs then
.start
.setorigmargs←true;
.origlmarg←lmarg;
.origrmarg←rmarg;
.origind←indent1;
.end;
.lindent1←indent1; lindent2←indent2;
.if "leftmarg" = null then lmar←3 else lmar←leftmarg;
.if "rightmarg" = null then rmar←3 else rmar←rightmarg;
.single space
.narrow lmar,rmar
.indent2←0;
.fill
.if "inden" = null then indent1←4 else indent1←inden;
.if "printform" = null then
.start
.count lists from 1 to 100 printing "1)";
.end
.else
.start
.count lists from 1 to 100 printing "printform";
.end
.⊃
.macro item ⊂
.next lists
{lists!⎇##{
.⊃
.macro endlist ⊂
.indent1←lindent1; indent2←lindent2;
.end continue ⊃

.MACRO sidechar(str,numblines) ⊂
.⊃
.
.MACRO endsidechar ⊂
.⊃
.macro defaultsidesettings ⊂
.⊃
.tstr←null;
.dstr←null;